//
//  NCTopStatusButton.m
//  新闻
//
//  Created by 小果 on 16/3/30.
//  Copyright © 2016年 小果. All rights reserved.
//

#import "NCTopStatusButton.h"
#import "NSString+Dir.h"

#define ANGLE180        (180 * M_PI / 180.0)

@implementation NCTopStatusButton

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        NSString *imagePath = kNCImagePath(@"channel_nav_arrow@2x.png");
        UIImage *image = [UIImage imageWithContentsOfFile:imagePath];
        
        [self setImage:image forState:UIControlStateNormal];
        self.imageView.transform = CGAffineTransformRotate(self.imageView.transform, ANGLE180);
    }
    
    return self;
}

- (void)setIsExpanded:(BOOL)isExpanded
{
    _isExpanded = isExpanded;
    
    [UIView animateWithDuration:0.25 animations:^{
        self.imageView.transform = CGAffineTransformRotate(self.imageView.transform, ANGLE180);
    }];
}

@end
